import request from '@/utils/request'

export function creatMenu(data) {
  return request({
    url: '/juanbusiness/app-nav-menu/add',
    method: 'post',
    data
  })
}

export function findMenu(page,size,name,id,appId,navBarId,usingStatus,visibility) {
  return request({
    url: '/juanbusiness/app-nav-menu/findPage',
    method: 'get',
    params: {
      nextPage: page,
      pageSize: size,
      name: name,
      id: id,
      appId: appId,
      navBarId: navBarId,
      usingStatus: usingStatus,
      visibility: visibility,
    }
  })
}

export function getMenu(id) {
  return request({
    url: '/juanbusiness/app-nav-menu/get',
    method: 'get',
    params: {
      id: id
    }
  })
}

export function updateMenu(data) {
  return request({
    url: '/juanbusiness/app-nav-menu/edit',
    method: 'put',
    data
  })
}

export function releaseMenu(id, operateId, usingStatus) {
  return request({
    url: '/juanbusiness/app-nav-menu/enable',
    method: 'put',
    params: {
      id: id,
      operateId: operateId,
      usingStatus: usingStatus
    }
  })
}

export function removedMenu(data) {
  return request({
    url: '/juanbusiness/app-nav-menu/remove',
    method: 'put',
    data
  })
}

export function delMenu(id) {
  return request({
    url: '/juanbusiness/app-nav-menu/del',
    method: 'delete',
    params: {id: id}
  })
}
